HashiCorp Certified: Terraform Associate (004) v1.0

Page:    1 / 7   
Exam contains 99 questions

Which syntax check returns an error when you run terraform validate?

  • A. None of these will return an error.
  • B. There is a missing variable block.
  • C. The state file does not match the current infrastructure.
  • D. The code contains tabs for indentation instead of spaces.


Answer : A

What is the purpose of the .terraform directory in a Terraform workspace?

  • A. The directory contains plugins and modules that Terraform downloads during initialization, along with other important information.
  • B. The directory contains the provide credentials and the .tfvars files to prevent them from being committed to version control by accident.
  • C. The directory is where Terraform creates and maintains the state file to track the underlying resources it creates and manages.
  • D. The directory is used to convert and store Terraform configuration files into API calls to communicate with the targeted platform.


Answer : A

How can terraform plan aid in the development process?

  • A. Validates your expectations against the execution plan without permanently modifying state.
  • B. Reconciles Terraform’s state against deploys resources and permanently modifies state using the current status of deployed resources.
  • C. Initializes your working directory containing your Terraform configuration files.
  • D. Formats your Terraform configuration files.


Answer : A

You have a saved execution plan containing desired changes for infrastructure managed by Terraform. After running the command terraform apply my.tfplan, you receive the error shown in the Exhibit space on this page.
| Error: Saved plan is stale
|
| The given plan file can no longer be applied because the state was changed by another operation after the plan was created.
How can you apply the desired changes? (Choose two.)

  • A. Generate a new execution plan file with terraform plan, and apply the new plan.
  • B. Run terraform apply without the saved execution plan.
  • C. Refresh the current state data using the -refresh-only flag.
  • D. Force the apply command by adding the flag -lock=false.
  • E. Update the current plan file using the terraform state push command.


Answer : AB

Which of these can you do with terraform plan? (Choose two.)

  • A. Schedule Terraform to run at a planned time in the future.
  • B. View the execution plan and check if the changes match your expectations.
  • C. Execute a plan in a different workspace.
  • D. Save a generated execution plan to apply later.


Answer : BD

Which task does terraform init not perform?

  • A. Sources any remote modules and downloads them.
  • B. Connects to the configured backend.
  • C. Validates that values are set for all required input variables.
  • D. Sources all providers used in the configuration and downloads them.


Answer : C

Which of the following arguments are required when declaring a Terraform output?

  • A. default
  • B. value
  • C. description
  • D. sensitive


Answer : B

Outside of the required_providers block, Terraform configurations always refer to providers by their local names.

  • A. True
  • B. False


Answer : A

The Exhibit section of this page shows part of a configuration you’ve been asked to update. data “azurerm_resource_group” “example” { name = var.resource_group_name
}
resource “azurerm_virtual_network” “example” {
name = ____________________
}
The name of the Azure Virtual Network should be set to the name of the resource group followed by a dash and the word “vnet”.
Which expression fulfills this requirement?

  • A. “${azurerm_resource_group.example.name}-vnet”
  • B. join(“-”,var.resource_group_name,“vnet”)
  • C. concat(data.azurerm_resource_group.example.name, “-”, “vnet”)
  • D. “${data.azurerm_resource_group.example.name}-vnet”


Answer : D

Your team is collaborating on infrastructure using Terraform and are formatting their code to follow Terraform language style conventions.
How can you update your code to meet these requirements?

  • A. Run terraform validate prior to executing terraform plan or terraform apply.
  • B. Replace all tabs with spaces within your Terraform configuration files.
  • C. Terraform automatically formats configuration on terraform apply.
  • D. Run terraform fmt to update your Terraform configurations.


Answer : D

A resource block is shown in the Exhibit space of this page.
resource “aws_instance” “web” {
count = 2
name = “terraform-${count.index}”
}
How do you reference the name value of the second instance of this resource?

  • A. aws_instance.web.*.name
  • B. aws_instance.web[2].name
  • C. element(aws_instance.web, 2)
  • D. aws_instance.web[1].name
  • E. aws_instance.web[1]


Answer : D

When using multiple configurations of the same Terraform provider, what meta-argument must you include in any non-default provider configurations?

  • A. alias
  • B. name
  • C. depends_on
  • D. id


Answer : A

You want to create a string that is a combination of a generated random_id and a variable and reuse that string several times in your configuration.
What is the simplest correct way to implement this without repeating the random_id and variable?

  • A. Add an output value.
  • B. Add a local value.
  • C. Use a data source.
  • D. Use a module.


Answer : B

Your Terraform configuration manages a resource that requires maximum uptime. You need to update the resource, and when you run terraform plan, Terraform notes that the update requires the resource to be destroyed and recreated.
Which lifecycle rule can you add to the resource to reduce the downtime of the resource while still applying the update?

  • A. prevent_destroy = true
  • B. destroy = false
  • C. create_before_destroy = true
  • D. ignore_changes = all


Answer : C

The Terraform configuration shown in the Exhibit space on this page will create a new AWS instance. data “aws_instance” “web” { filter { name = “tag:Name” values = [“web”]
}
}

  • A. True
  • B. False


Answer : B

Page:    1 / 7   
Exam contains 99 questions

Talk to us!


Have any questions or issues ? Please dont hesitate to contact us

Certlibrary.com is owned by MBS Tech Limited: Room 1905 Nam Wo Hong Building, 148 Wing Lok Street, Sheung Wan, Hong Kong. Company registration number: 2310926
Certlibrary doesn't offer Real Microsoft Exam Questions. Certlibrary Materials do not contain actual questions and answers from Cisco's Certification Exams.
CFA Institute does not endorse, promote or warrant the accuracy or quality of Certlibrary. CFA® and Chartered Financial Analyst® are registered trademarks owned by CFA Institute.
Terms & Conditions | Privacy Policy | Amazon Exams | Cisco Exams | CompTIA Exams | Databricks Exams | Fortinet Exams | Google Exams | Microsoft Exams | VMware Exams